/*
 * @Author: your name
 * @Date: 2021-07-21 23:02:16
 * @LastEditTime: 2021-07-30 20:20:44
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \hrsaas\src\api\setting.js
 */
import request from '@/utils/request'

/**
 * 获取角色列表
 * ***/
export function getRoleList(params) {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}

/**
* 获取公司信息
* **/
export function getCompanyInfo(companyId) {
  return request({
    url: `/company/${companyId}`
  })
}
/** ** *  删除角色 * * ****/
export function deleteRole(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}

// 更新角色
export function updateRole(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
  })
}

// 获取角色详情

export function getRoleDetails(id) {
  return request({
    url: `/sys/role/${id}`
  })
}

// 新增角色
export function addRole(data) {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}

// 给角色分配权限
export function AssignPerm(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
